how to: C++ function to be called from material BP

I know how to implement a simple BlueprintPure function like

float UMyBlueprintFunctionLibrary::FloatINeed()
{
return 0.;
}

and call it from a class blueprint.

Is there a way to implement such a function so that it can be called from the material BP?