Replace & Rationalize
- To: mathgroup at smc.vnet.net
- Subject: [mg121509] Replace & Rationalize
- From: "Chris Degnen" <degnen at cwgsy.net>
- Date: Sun, 18 Sep 2011 04:10:01 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
Further to a question on Stack Overflow I noticed a puzzling evaluation. Why does the second expression generate reals? (x \[Function] If[IntegerQ[Rationalize[x]], Rationalize[x], x]) /@ {0., 1.} {0., 1.} /. x_ /; IntegerQ[Rationalize[x]] -> Rationalize[x]
- Follow-Ups:
- Re: Replace & Rationalize
- From: Heike Gramberg <heike.gramberg@gmail.com>
- Re: Replace & Rationalize
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Replace & Rationalize
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Replace & Rationalize