Skip to content

Fixed-point equations #19

@depler

Description

@depler

How to implement arbitrary precision arithmetic with fixed point? Let's say we have this code:

var ctx = EContext.ForPrecision(5);
var a = EDecimal.FromString("2");
var b = a.Sqrt(ctx);

That means 5 total digits (both integer and fractional part), so it produces result 1.4142 which is not what I need. I want to call something like EContext.ForFixedPrecision(5) and always get results with 5 digits after point (while integer part remains unlimited). Is it possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions