Teen Programmers Unite  
 

 

Return to forum top

do long variable doesnt give the exact answere ???

Posted by rollic2002 [send private reply] at June 01, 2002, 12:44:53 PM

guys i did a program to give where you can input 5 numbers
and it will gives you it's frequency and proportionality
i used longs in it so it didnt give me the exact answeres so what can io use to get the exact ones .

Posted by RedX [send private reply] at June 01, 2002, 01:12:41 PM

It might help if you told us what language you use.

RedX

Posted by unknown_lamer [send private reply] at June 01, 2002, 05:19:51 PM

If he said longs, you can safely assume C. Answering the question: long is just shorthand for long int, so you probably want to use long double instead so you don't lose the fractional part of the number.

Posted by Psion [send private reply] at June 01, 2002, 07:45:15 PM

No, Java also has long.

Posted by unknown_lamer [send private reply] at June 01, 2002, 09:56:29 PM

But Java also has a long double type...(right?)

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.