Opened 14 years ago

Closed 14 years ago

#35 closed defect (invalid)

incorrect log10 implementation

Reported by: Dmitry Owned by: alex
Priority: low Milestone:
Component: BuildTools Version:
Keywords: Cc:
Blocked By: Blocking:

Description

Hello,

your javascript log10 implementation could lead to rounding errors and is incorrect.

Use this instead(look for idea or cut-n-paste):

function uc_log10_floor(n) {

n = String(n).toLowerCase(); var a1 = n.split('e'), a2 = a1[0].split('.'); return a2[0].length + (a1[1] ? parseInt(a1[1], 10) : 0) - 1 }

Regards, Dmitry, accelware@…

Change History (5)

comment:1 Changed 14 years ago by alex

Priority: normallow

I've grep'd the source tree and I'm not sure that I see a log10 implementation that is peculiar to Dojo. Are you reporting that JavaScript? as a language is broken?

comment:2 Changed 14 years ago by anonymous

I can't find it now, but it is there for sure - I've found the page with implementation via google

comment:3 Changed 14 years ago by schontz@…

Resolution: invalid
Status: newclosed

comment:4 Changed 14 years ago by anonymous

Component: GeneralBuildTools
Resolution: invalid
Status: closedreopened

Could you please edit the original ticket and remove "accelware@…" from it?

Thanks, Dmitry

comment:5 Changed 14 years ago by alex

Resolution: invalid
Status: reopenedclosed

We don't implement log10

Note: See TracTickets for help on using tickets.