Skip to content

Simplify logic of from(unsigned)#10

Merged
z-tech merged 2 commits intosmall_fpfrom
update_from_u8_from_u16
Nov 11, 2025
Merged

Simplify logic of from(unsigned)#10
z-tech merged 2 commits intosmall_fpfrom
update_from_u8_from_u16

Conversation

@z-tech
Copy link
Collaborator

@z-tech z-tech commented Nov 11, 2025

What does this PR do?

  • calls from(u128) in functions: from(u8), from(u16), from(u32), from(u64)
  • performs reduction in from(u128) needed to match behavior of BigInt impl
    let test0 = M31::from(9991293939349493_u128);
    let test1 = SmallM31::from(9991293939349493_u128);
    println!("test0: {}", test0);
    println!("test1: {}", test1);
    
    output:
    test0: 1717630467
    test1: 1717630467
    

@z-tech z-tech changed the title chkpt Simplify logic of from(u8) and from(u16) Nov 11, 2025
@z-tech z-tech changed the title Simplify logic of from(u8) and from(u16) Simplify logic of from(unsigned) Nov 11, 2025
@z-tech z-tech merged commit 70f96cc into small_fp Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant