[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: [Tomasz] 1 / 0 = 0?



PureBytes Links

Trading Reference Links

I thought that according to IEEE standards 30/0 = Inf

That is also what I was taught in school.

Examples from: http://www2.hursley.ibm.com/decimal/daops.html

"Examples involving special values: 

  add('Infinity', '1')        ==>  'Infinity'
  add('NaN', '1')             ==>  'NaN'
  subtract('1', 'Infinity')   ==>  '-Infinity'
  multiply('-1', 'Infinity')  ==>  '-Infinity'
  subtract('-0', '0')         ==>  '-0'
  multiply('-1', '0')         ==>  '-0'
  divide('-1', 'Infinity')    ==>  '-0'
  divide('1', '0')            ==>  'Infinity'
  divide('1', '-0')           ==>  '-Infinity'
  divide('-1', '0')           ==>  '-Infinity' "

Ion


--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Hello,
> 
> (30/0) is NaN  - NOT a NUMBER 
> 
> Division by zero is illegal operation.
> 
> If there was no protection against dividing by zero
> the program would just bomb out (crash and say good bye).
> 
> Therefore when dividing two numbers X / Y AB checks
> if Y is equal to zero and always returns zero in that case.
> 
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: <mik-u@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, March 03, 2003 4:00 AM
> Subject: [amibroker] [Tomasz] 1 / 0 = 0?
> 
> 
> > Tomasz,
> > 
> > AB returning 0 for an expression like 1 / 0. Is it correct?
> > 
> > The following expression
> > 
> >    100 - 100 / (1 + 30 / 0) 
> > 
> > is equal 0 in AB, but I think it should be equal 100.
> > 
> > Thanks,
> > Mike
> > 
> > 
> > 
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > 
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/ 
> > 
> > 
> >


------------------------ Yahoo! Groups Sponsor ---------------------~-->
New Yahoo! Mail Plus. More flexibility. More control. More power.
Get POP access, more storage, more filters, and more.
http://us.click.yahoo.com/Hcb0iA/P.iFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/