title: Modulus Two Float Double Numbers
signature: class Solution {
  
      public Double modulusTwoFloatDoubleNumbers(Double a, Double b) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Double a, Double b, Double expected){
          try{
              Driver driver = new Driver();
              if (driver.run(a, b,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(3243.229719038493, 5659.926861939672, 3243.229719038493);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(-4362.665881044217, -9196.507113304497, 4362.665881044217);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(7255.066257575837, 2623.200060506935, 2008.6661365619666);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(-6929.554320261099, -3009.0234530313287, 911.5074141984414);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(3569.942027998315, 6920.809419868375, 3569.942027998315);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(-6513.849053096595, -70.95992406437102, 56.49596323882673);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(7333.183189243961, 580.3500610971768, 368.98245607783906);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(-2856.1752826258803, -9625.97442825802, 2856.1752826258803);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(9787.228111241662, 2419.6844962423256, 108.4901262723597);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(-1722.873699288031, -8370.700544254058, 1722.873699288031);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Double a, Double b, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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;
  }