radix 1.0.2 icon indicating copy to clipboard operation
radix: ^1.0.2 copied to clipboard

Dart library for base arithmetic. It handles basic arithmetic operations as well as parsing and conversion on decimal.

Radix #

A Dart package that handles base arithmetics operations.

Installing #

  1. Depend on it

Add the package in your pubspec.yaml file

dependencies:
  radix: ^0.1.0
  1. Install it You can install package from the command line
  • with pub:

    pub get
    
  • with flutter:

    flutter pub get
    

    Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

  1. Import it

Now in Dart code you can use:

import 'package:radix/radix.dart';

A simple usage example #

import 'package:radix/radix.dart';

void main(List<String> arguments) {
  /// Create a base 5
  var a = Radix(base: 5);

  /// Initialize the content
  a.content = 2114;
  print(a.toString());

  /// Parse 2110 in base 5
  var b = 2210.inBase(5);
  print(b.toString());

  /// Calculate the sum
  print('${a.toString()} + ${b.toString()} = ${(a + b).toString()}');

  /// Calculate the difference
  print('${a.toString()} - ${b.toString()} = ${(a - b).toString()}');

  /// Calculate the multiplication
  print('${a.toString()} * ${b.toString()} = ${(a * b).toString()}');

  /// Calculate the division
  print('${a.toString()} / ${b.toString()} = ${(a / b).toString()}');
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
30
pub points
0%
popularity

Publisher

verified publisher iconmakepad.fr

Dart library for base arithmetic. It handles basic arithmetic operations as well as parsing and conversion on decimal.

License

Icon for licenses.MIT (LICENSE)

More

Packages that depend on radix