Boa: Implement the rest of `Math` methods

Created on 24 Jun 2020  路  9Comments  路  Source: boa-dev/boa

Implement Math methods:

  • [x] Math.clz32()
  • [x] Math.expm1()
  • [x] Math.fround()
  • [x] Math.hypot()
  • [x] Math.log1p()
  • [x] Math.imul()
enhancement good first issue builtins

Most helpful comment

Do we have a guide for writing tests?

Not really. we really should have one [...]

Maybe this is something I can help with?

All 9 comments

Hey, I'm new, but I would like to take these.

Hey, I'm new, but I would like to take these.

Sure. go for it! If you have any questions or need any assistance just ask :)

@mr-rodgers a good example of a Math method is abs: https://github.com/boa-dev/boa/blob/master/boa/src/builtins/math/mod.rs#L43-L45

after we create the methods we need to register them here like abs: https://github.com/boa-dev/boa/blob/master/boa/src/builtins/math/mod.rs#L478

I think we missed Math.imul(a: f64, b:f64) -> i32;

I think we missed Math.imul(a: f64, b:f64) -> i32;

Good catch! I'll add it to the list :)

Do we have a guide for writing tests?

Do we have a guide for writing tests?

Not really. we really should have one, but for now here is an example of how we test abs: https://github.com/boa-dev/boa/blob/master/boa/src/builtins/math/tests.rs#L6-L22

Also the Math tests should go in this file

Hope this helps.

Do we have a guide for writing tests?

Not really. we really should have one [...]

Maybe this is something I can help with?

Maybe this is something I can help with?

Yes. It would be awesome to have it for newcomers to the project :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HalidOdat picture HalidOdat  路  5Comments

IovoslavIovchev picture IovoslavIovchev  路  4Comments

hello2dj picture hello2dj  路  5Comments

Razican picture Razican  路  5Comments

croraf picture croraf  路  5Comments