# Simplest way to export (and import) definitions?

Consider I have this code :

f[1]=2
f[1.5]=6
f[3]=4


What is the simplest way to save the array f defined on those three numbers in a file ? (in my case, I will have a lot of values, not juste three but the indices of my array will be regularly spaced).

How can I tell in a simple way to mathematica I want to save the full array f ? Am I forced to somehow loop on the indices ?

Both Save[filename,f] and DumpSave[filename,f] will do. You can read the definitions back with Get[filename].
• It only looks like there are underscores because I've made hyperlinks. Just Save[filename,f]. By the way, f is not an array. – Roman Jun 23 at 17:26