Back to index

php5  5.3.10
Functions
zero.c File Reference
#include <config.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include "bcmath.h"
#include "private.h"

Go to the source code of this file.

Functions

char bc_is_zero (bc_num num TSRMLS_DC)

Function Documentation

char bc_is_zero ( bc_num num  TSRMLS_DC)

Definition at line 44 of file zero.c.

{
  int  count;
  char *nptr;

  /* Quick check. */
  if (num == BCG(_zero_)) return TRUE;

  /* Initialize */
  count = num->n_len + num->n_scale;
  nptr = num->n_value;

  /* The check */
  while ((count > 0) && (*nptr++ == 0)) count--;

  if (count != 0)
    return FALSE;
  else
    return TRUE;
}

Here is the caller graph for this function: