title: Modulus Two Float Double Numbers
signature: class Solution {
  
      public decimal ModulusTwoFloatDoubleNumbers(decimal a, decimal b) {
test_code: using System;
  using System.Numerics;
  using System.Diagnostics;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Security.Cryptography;
  using System.Web.UI;
  using System.Web.Script.Serialization;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  namespace EvaluatePrediction {
      class TestRunner {
          public bool ValidateSolution(decimal actual, decimal expected){
              return Math.Abs(actual - expected) < 1e-09m;
          }
  
          public string driver(decimal a, decimal b, decimal expected){
              try{
                PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();
                decimal pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, b); 
                if (ValidateSolution(
                      pred_result,
                      expected)){
                  return "PASSED";
                }
                return "FAILED";
              } 
              catch (Exception exception_obj)
              {
                return exception_obj.GetType().FullName;
              }
          }
          static void Main(string[] args) {
              TestRunner runner = new TestRunner();
              String result;
              result = runner.driver(
                  3243.229719038493m, 5659.926861939672m, 
                  3243.229719038493m
              );
              Console.WriteLine(string.Format(
                  "TEST-0...{0}",
                  result)
              );result = runner.driver(
                  -4362.665881044217m, -9196.507113304497m, 
                  4362.665881044217m
              );
              Console.WriteLine(string.Format(
                  "TEST-1...{0}",
                  result)
              );result = runner.driver(
                  7255.066257575837m, 2623.200060506935m, 
                  2008.6661365619666m
              );
              Console.WriteLine(string.Format(
                  "TEST-2...{0}",
                  result)
              );result = runner.driver(
                  -6929.554320261099m, -3009.0234530313287m, 
                  911.5074141984414m
              );
              Console.WriteLine(string.Format(
                  "TEST-3...{0}",
                  result)
              );result = runner.driver(
                  3569.942027998315m, 6920.809419868375m, 
                  3569.942027998315m
              );
              Console.WriteLine(string.Format(
                  "TEST-4...{0}",
                  result)
              );result = runner.driver(
                  -6513.849053096595m, -70.95992406437102m, 
                  56.49596323882673m
              );
              Console.WriteLine(string.Format(
                  "TEST-5...{0}",
                  result)
              );result = runner.driver(
                  7333.183189243961m, 580.3500610971768m, 
                  368.98245607783906m
              );
              Console.WriteLine(string.Format(
                  "TEST-6...{0}",
                  result)
              );result = runner.driver(
                  -2856.1752826258803m, -9625.97442825802m, 
                  2856.1752826258803m
              );
              Console.WriteLine(string.Format(
                  "TEST-7...{0}",
                  result)
              );result = runner.driver(
                  9787.228111241662m, 2419.6844962423256m, 
                  108.4901262723597m
              );
              Console.WriteLine(string.Format(
                  "TEST-8...{0}",
                  result)
              );result = runner.driver(
                  -1722.873699288031m, -8370.700544254058m, 
                  1722.873699288031m
              );
              Console.WriteLine(string.Format(
                  "TEST-9...{0}",
                  result)
              );
          }
      }
  }
  
source_py: def modulus_two_float_double_numbers(a, b):
      if (a < 0):
          a = (- a)
      if (b < 0):
          b = (- b)
      mod = a
      while (mod >= b):
          mod = (mod - b)
      if (a < 0):
          return (- mod)
      return mod
source_cpp: double modulus_two_float_double_numbers(double a, double b) {
    double mod;
    if ( a < 0 ) mod = - a;
    else mod = a;
    if ( b < 0 ) b = - b;
    while ( mod >= b ) mod = mod - b;
    if ( a < 0 ) return - mod;
    return mod;
  }