Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: Help with creating a function
Replies: 12   Last Post: Nov 19, 2013 3:48 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Richard Tobin

Posts: 1,264
Registered: 12/6/04
Re: Help with creating a function
Posted: Nov 18, 2013 7:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <ugnj89poilcj8f2uot0qjhqnk8um0dhmjp@4ax.com>,
quasi <quasi@null.set> wrote:

> f(x) = ((x-1)*(((2*x-1)/abs(2*x-1))+1)/2)+1

Extracting the more generally useful function out of this,

(x-0.5) / abs(x-0.5)

is 1 for integer x > 0, -1 for integer x <= 0

Using Knuth's [] notation, the original function can be written as

x + [x=0]

See http://arxiv.org/abs/math/9205211 (which coincidentally has some
comments on the definedness of 0^0).

-- Richard



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.