Ruby BigDecimal sanity check (floating point newb)

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-06-14T18:04:29Z Indexed on 2010/06/14 21:32 UTC
Read the original article Hit count: 277

Hello, Hoping to get some feedback from someone more experienced here. I haven't dealt with the dreaded floating-point calculation before...

Is my understanding correct that with Ruby BigDecimal types (even with varying precision and scale lengths) should calculate accurately or should I anticipate floating point shenanigans?

All my values within a Rails application are BigDecimal type and I'm seeing some errors (they do have different decimal lengths), hoping it's just my methods and not my object types...

Thanks!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby