Skip to content
Snippets Groups Projects
Select Git revision
  • de1fcffdf138138dd942a40e8f75e2bd9cd71a96
  • main default protected
  • bugfix/fix-routing
  • bugfix/fix-html-and-css
  • bugfix/test
  • feature/add-signup-validation
  • feature/add-update-information-validator
  • feature/add-login-validator
  • feature/add-payment-validator
  • feature/add-admin-view
  • feature/add-orders-html
  • bugfix/fix-html-feedback
  • chore/refacto-code
  • feature/add-update-user-html
  • feature/add-product-html
  • feature/add-card-html
  • feature/add-sign-up-html
  • feature/add-login-html
  • bugfix/fix-pop-up
  • feature/add-routings-configuration
  • feature/add-cards-html
21 results

admin.component.spec.ts

Blame
  • Forked from Shop Sphere / frontend
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Helpers.java 834 B
    package mandelbrot;
    
    /**
     * Some helpful functions and values.
     */
    class Helpers {
        /**
         * A small double used to bound the precision of the comparison of doubles.
         */
        final static double EPSILON = 1e-9;
    
        /**
         * Comparison of doubles (up to <code>EPSILON</code>)
         * <p>
         * Please note that floating-point comparison is very tricky, this function
         * is not suited to compare small floating-point numbers.
         *
         * @param d1 an arbitrary double
         * @param d2 an arbitrary double
         * @return the result of comparing <code>d1</code> and <code>d2</code>.
         */
        static int doubleCompare(double d1, double d2) {
            double diff = d1 - d2;
            return
                    (diff > EPSILON) ? 1 :
                            (diff < -EPSILON) ? -1 :
                                    0;
        }
    }