Monk Multiplication Operation On Rational Numbers Produces Irrational Product (Doc ID 1410008.1)

Last updated on JULY 26, 2012

Applies to:

Sun Schema Runtime Environment (SRE) - Version 5.0.5u2 and later
Information in this document applies to any platform.
Checked for currency JUL-26-2012

Symptoms

On : SRE 5.0.5U2 Monk function

ACTUAL BEHAVIOR
---------------

When performing multiplication operation on two rational numbers, the user gets an irrational product. This seems to occur when the variable holding one of the numbers starts as a string and is converted to a number using string->number function.

Also occurs in context of the eway: stcewgenericmonk.exe

for example:
when sAmount was a variant set = "32.48"

(display (* (string->number sAmount) 100))
results to: 32479999999999999999


EXPECTED BEHAVIOR
-----------------------

It should be 3248.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms