Skip to content

[Feature] Unified type convert api of U256 and I256 #900

@clouds56

Description

@clouds56

Component

primitives

Describe the feature you would like

Now we could use U256::to::<u64>() and I256::as_u64(), but not vice visa.

In addition

  • There's no I256::as_u128/I256::as_i128
  • We have to use f64::from(U256), but not U256::to::<f64>()
  • There's even no f64::from(I128)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions