Comment

Comment by j-walker

Can someone explain to me why in Section 4: Functions they compute Twice by multiplying the number by three then subtracting the number once? Is it just to showcase more math, or is there a detail I'm missing?

> /* Computes double of a number. Works by tripling the number, and then subtracting to get back to double. /

   static int Twice(int num) {

      int result = num * 3;

      result = result - num;

      return(result);**
parent j-walker 4 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton