Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11089

Putting a Test or Condition on the Right-Hand Side of a Function

From Gregory Lypny <gregory.lypny@videotron.ca>
Newsgroups comp.soft-sys.math.mathematica
Subject Putting a Test or Condition on the Right-Hand Side of a Function
Date 2012-07-26 07:38 +0000
Message-ID <juqs5s$67q$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Hello everyone,

I have a simple function that displays the integer part of a real number if the fraction part is less than a millionth.

	dropDecimal[x_] := If[FractionalPart[x] < .000001, IntegerPart[x], x]

In trying to learn more about functional programming, I was wondering whether there is a way to put the condition or test on the right-hand side of the 
function.

Gregory

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Putting a Test or Condition on the Right-Hand Side of a Function Gregory Lypny <gregory.lypny@videotron.ca> - 2012-07-26 07:38 +0000
  Re: Putting a Test or Condition on the Right-Hand Side of a Function Sébastien Roy <roys3d@gmail.com> - 2012-07-27 08:59 +0000

csiph-web