Talk About Network



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 > Forth > Re: >FLOAT beha...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 8 Topic 3980 of 4053
Post > Topic >>

Re: >FLOAT behavior with null string

by Elizabeth D Rather <erather@[EMAIL PROTECTED] > Mar 29, 2008 at 08:22 AM

Krishna Myneni wrote:
> The specification of >FLOAT in DPANS94 suggests that it treat a string
> of blanks as a representation of zero (below). Common practice among
> Forth systems (pfe, gforth, bigforth) appears to extend this suggested
> behavior to  null strings as well, e.g.
> 
> s" " >FLOAT
> 
> returns a true flag on the stack, and fp zero on the floating point
> stack. Is there a strong argument for considering a null string to be a
> valid representation of fp zero. I would have implemented the conversion
> to return a false flag. Also, I don't much like the idea of treating a
> string of blanks as a valid representation for 0E either, but perhaps
> there was some valid reason for suggesting this behavior.
> 
> Krishna
> --

To my best (fading) recollection, this was a recognition of existing 
common practice in the FP implementations we looked at.  The thought was 
that illegal characters could invalidate the conversion, but nothing else.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310-491-3356
5155 W. Rosecrans Ave. #1018  Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================




 8 Posts in Topic:
>FLOAT behavior with null string
Krishna Myneni <krishn  2008-03-29 13:01:12 
Re: >FLOAT behavior with null string
Bruce McFarling <agila  2008-03-29 11:19:12 
Re: >FLOAT behavior with null string
Elizabeth D Rather <er  2008-03-29 08:22:04 
Re: >FLOAT behavior with null string
Krishna Myneni <krishn  2008-03-29 17:03:18 
Re: >FLOAT behavior with null string
mhx@[EMAIL PROTECTED] (M  2008-03-29 22:54:13 
Re: >FLOAT behavior with null string
Bruce McFarling <agila  2008-03-29 16:45:12 
Re: >FLOAT behavior with null string
"Ed" <nospam  2008-03-30 13:14:19 
Re: >FLOAT behavior with null string
Bruce McFarling <agila  2008-03-29 21:53: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 May 17 0:25:31 CDT 2008.