Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Is there a simple way to transform 1.1 to 11/10

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93137] Re: [mg93125] Re: Is there a simple way to transform 1.1 to 11/10
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Tue, 28 Oct 2008 04:54:18 -0500 (EST)
  • References: <200810240629.CAA22968@smc.vnet.net> <6ED845A5-F77F-42AE-A3EF-E8A15F2DCA10@mimuw.edu.pl> <18689.46568.972349.540344@frac.u-strasbg.fr> <8C37CE0B-6BE6-47CE-B698-8363ABF27BF4@mimuw.edu.pl> <0061C0C7-4D40-4D33-964A-81FBB338A52A@mimuw.edu.pl> <730D4D3D-4AA2-41A7-9E21-DA23A0694D7A@mimuw.edu.pl> <18689.54940.101.812951@frac.u-strasbg.fr> <gdug9p$jp0$1@smc.vnet.net> <200810270814.DAA29159@smc.vnet.net>

On 27 Oct 2008, at 17:14, Alain Cochard wrote:

>> Is this entire discussion motivated by your desire to avoid pressing
>> keys on your keyboard?
>
> That's one way to put it.  I'd rather say that I like elegant
> solutions.  Anyway, transforming a lot of such numbers is error prone
> and way too time consuming, to the extent that it simply cannot be
> done.
>
> a.


If what you really want is an "key-stroke efficient" way to input  
fraction than probably you should think of a completely different  
approach. Forget about Mathematica's "decimals", which are actually  
approximate ("inexact") numbers, completely different entities from  
decimals in ordinary arithmetic, and define your own input. For  
example, you could define a function ff like this:

ff[n_Integer, a_Integer] := FromDigits[{IntegerDigits[a], n}]

You simply enter an integer which specifies how many digits there are  
before the decimal point and then type in your decimal fraction  
omitting the dot. So

  ff[1, 10000000000000001]
  10000000000000001/10000000000000000

ff[2, 10000000000000001]
10000000000000001/1000000000000000

ff[0, 10000000000000001]
10000000000000001/100000000000000000

ff[-1, 10000000000000001]
10000000000000001/1000000000000000000

seems to me more convenient than typing in strings.

Andrzej Kozlowski




  • Prev by Date: Re: Contourplot3d of a list of expressions
  • Next by Date: Re: Looking for Stop
  • Previous by thread: Re: Is there a simple way to transform 1.1 to 11/10
  • Next by thread: Contourplot3d of a list of expressions