fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

simple arithmetic does not work for `i128`

Open fridis opened this issue 1 year ago • 0 comments

u128 works as expected with this small example:

 > ./build/bin/fz -e "say (u128.one + u128.one)"
2

i128 does not:

 > ./build/bin/fz -e "say (i128.one + i128.one)"

$MODULE/i128.fz:28:8: error 1: Used abstract features 'num.wrap_around.wrapped_on_neg', 'num.wrap_around.overflow_on_add', 'num.wrap_around.underflow_on_add', 'num.wrap_around.prefix -°', 'numeric.infix %', 'numeric.as_u8' are not implemented by 'i128'
public i128(public hi i64, public lo u64) : num.wrap_around, has_interval is
-------^^^^
Feature 'i128' instantiated at $MODULE/i128.fz:45:28:
  public fixed type.max => i128 0x_7fff_ffff_ffff_ffff 0x_ffff_ffff_ffff_ffff
---------------------------^^^^
inherits or declares abstract feature 'num.wrap_around.wrapped_on_neg' declared at $MODULE/num/wrap_around.fz:36:10:
  public wrapped_on_neg bool => abstract

fridis avatar May 23 '24 20:05 fridis