Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with converting a floating-point value into a long value

Hi,

i encountert a problem with the conversion of a floating-point value into a simple long value. It seems like it only works correct with a decimal value as well as a constant.

eg.

long ( 99.8 ) = 100

which is totally fine,but the following seems wrong to me

DOUBLE ldbl_value = 99.8

long ( ldbl_value ) = 99

Why do i get a different result with that code?

What do you think of that?

I enclosed an image of a list, which showes how the conversion is creating different results, depending on the input type.

Best Regards

TimKp

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question