title: Modulus Two Float Double Numbers
signature: func modulusTwoFloatDoubleNumbers(a float64, b float64) float64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual float64, expected float64) bool {
      return math.Abs(actual - expected) < 1e-09
  }
  
  func driver(a float64, b float64, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(a, b),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(3243.229719038493, 
  	5659.926861939672, 3243.229719038493)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(-4362.665881044217, 
  	-9196.507113304497, 4362.665881044217)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(7255.066257575837, 
  	2623.200060506935, 2008.6661365619666)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(-6929.554320261099, 
  	-3009.0234530313287, 911.5074141984414)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(3569.942027998315, 
  	6920.809419868375, 3569.942027998315)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(-6513.849053096595, 
  	-70.95992406437102, 56.49596323882673)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(7333.183189243961, 
  	580.3500610971768, 368.98245607783906)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(-2856.1752826258803, 
  	-9625.97442825802, 2856.1752826258803)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(9787.228111241662, 
  	2419.6844962423256, 108.4901262723597)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(-1722.873699288031, 
  	-8370.700544254058, 1722.873699288031)
      fmt.Printf("TEST-9...%s\n", 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;
  }