Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: How many fl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 12 Topic 15906 of 16566
Post > Topic >>

Re: How many float values in range 0f - 1f inclusive?

by Patricia Shanahan <pats@[EMAIL PROTECTED] > Mar 23, 2008 at 08:04 AM

Alex.From.Ohio.Java@[EMAIL PROTECTED]
 wrote:
> On Mar 23, 9:53 am, Patricia Shanahan <p...@[EMAIL PROTECTED]
> wrote:
>> I don't understand this test. Why "f<=2f" rather than "f<=1f"? 1.5f is
>> exactly representable and is less than 2f, but is not in the required
range.
>>> 1073741826 4294967296
>>> 1.073741824E9
> 
> You are right. I played with it a little and forgot to change back.
> 
> 1065353218 4294967296
> 1.073741824E9
> 
> Alex.

This differs by one from 1065353217, the result of my original
suggestion: "Each bit pattern in the range Float.floatToIntBits(0f)
through Float.floatToIntBits(1f) corresponds to a float value in the
specified range.".

The difference is a matter of question interpretation. Should zero be
counted once, because it is one value, equal to itself, or twice because
it has two representations that behave differently in some ways?

Patricia
 




 12 Posts in Topic:
How many float values in range 0f - 1f inclusive?
"Jeff Higgins"   2008-03-22 11:26:54 
Re: How many float values in range 0f - 1f inclusive?
Patricia Shanahan <pat  2008-03-22 09:31:16 
Re: How many float values in range 0f - 1f inclusive?
Alex.From.Ohio.Java@[EMAI  2008-03-22 11:27:56 
Re: How many float values in range 0f - 1f inclusive?
Patricia Shanahan <pat  2008-03-22 11:55:48 
Re: How many float values in range 0f - 1f inclusive?
Lew <lew@[EMAIL PROTEC  2008-03-22 16:34:19 
Re: How many float values in range 0f - 1f inclusive?
"Jeff Higgins"   2008-03-22 19:23:55 
Re: How many float values in range 0f - 1f inclusive?
"John B. Matthews&qu  2008-03-22 22:15:26 
Re: How many float values in range 0f - 1f inclusive?
"Jeff Higgins"   2008-03-24 08:13:54 
Re: How many float values in range 0f - 1f inclusive?
Alex Kizub <akizub@[EM  2008-03-23 06:09:11 
Re: How many float values in range 0f - 1f inclusive?
Patricia Shanahan <pat  2008-03-23 06:53:32 
Re: How many float values in range 0f - 1f inclusive?
Alex.From.Ohio.Java@[EMAI  2008-03-23 07:35:31 
Re: How many float values in range 0f - 1f inclusive?
Patricia Shanahan <pat  2008-03-23 08:04:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:35:34 CST 2008.