Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi Purpose Calculator
#5
(10-24-2010, 09:14 PM)Reality Wrote: Thanks Disease, never knew that.

I had taken return 0; out because of the while (choice < 100) { loop, but I guess your placement lets it work.

Also, is there a way to have like double and float? Is that a class or something? Dunno them yet.

Why would you need both? If you need the precision of a double then just use that over float. The performance difference between floats and doubles is virtually nonexistent these days. Modern CPUs all have floating point units (FPUs) built in. Most FPUs don't even distinguish between float and double.

Barring performance the only difference between the two is memory usage. A float uses up 4 bytes while a double uses 8. Given that on the low end PCs have 1-2GBs of RAM, the memory usage isn't a problem for modern programmers. Especially considering your application only has a maximum of four.

Also, functions must always return the data type they are declared as. The one excepting being a void function, because that's what void represents: nothing. The main function is declared as an integer, thus it must always return an integer. You having a loop inside the function doesn't change that.
Ho, ho, ho! Well, if it isn't fat stinking billy goat Billy Boy in poison!
How art thou, thou globby bottle of cheap, stinking chip oil?
Come and get one in the yarbles, if ya have any yarbles, you eunuch jelly thou!
Reply


Messages In This Thread
Multi Purpose Calculator - by Reality - 10-22-2010, 10:05 PM
RE: Multi Purpose Calculator - by Reality - 10-24-2010, 07:22 PM
RE: Multi Purpose Calculator - by Disease - 10-24-2010, 08:21 PM
RE: Multi Purpose Calculator - by Reality - 10-24-2010, 09:14 PM
RE: Multi Purpose Calculator - by Disease - 10-25-2010, 04:13 AM
RE: Multi Purpose Calculator - by Reality - 10-25-2010, 12:37 PM
RE: Multi Purpose Calculator - by Disease - 10-25-2010, 02:10 PM
RE: Multi Purpose Calculator - by Reality - 10-25-2010, 05:04 PM
RE: Multi Purpose Calculator - by Disease - 10-25-2010, 05:22 PM
RE: Multi Purpose Calculator - by Reality - 10-25-2010, 07:33 PM
RE: Multi Purpose Calculator - by haphazard - 10-27-2010, 07:04 PM
RE: Multi Purpose Calculator - by Hustler - 10-27-2010, 07:05 PM
RE: Multi Purpose Calculator - by Reality - 10-27-2010, 07:05 PM
RE: Multi Purpose Calculator - by Hustler - 10-27-2010, 07:11 PM
RE: Multi Purpose Calculator - by Reality - 10-27-2010, 07:25 PM
RE: Multi Purpose Calculator - by Disease - 10-27-2010, 07:23 PM
RE: Multi Purpose Calculator - by Arеs - 11-01-2010, 09:10 AM
RE: Multi Purpose Calculator - by Disease - 11-01-2010, 09:45 AM
RE: Multi Purpose Calculator - by Reality - 11-01-2010, 09:43 AM
RE: Multi Purpose Calculator - by Reality - 11-01-2010, 09:48 AM
RE: Multi Purpose Calculator - by Bursihido - 12-13-2010, 10:50 PM
RE: Multi Purpose Calculator - by Buzz Lightyear - 12-14-2010, 06:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  my own calculator WHITE PANDA 8 2,188 07-14-2010, 03:19 PM
Last Post: Kondry
  Calculator v1 Brainless Control 21 5,220 01-18-2010, 10:34 PM
Last Post: Equinøx
  Calculator in C Liberty 4 1,318 12-10-2009, 11:45 PM
Last Post: Sagittarius

Forum Jump:


Users browsing this thread: 12 Guest(s)